import React, { Component } from 'react'
import { Grid } from 'antd-mobile'

class HotCate extends Component {
  goCate = (id) => () => {
    this.props.history.push(`/cateDetail/${id}`)
  }
  render() {
    const { data } = this.props
    return (
      <div className="home-hot-cate">
        <div className="title">精品分类</div>
        <Grid
          data={data}
          activeStyle={false}
          renderItem={(record) => {
            return (
              <div
                onClick={this.goCate(record.id)}
                className="am-grid-item-inner-content column-num-4"
              >
                <div className="am-grid-text">{record.title}</div>
              </div>
            )
          }}
        />
      </div>
    )
  }
}

export default HotCate
